

//
//  PushViewController.m
//  核心动画
//
//  Created by MyMac on 15/6/7.
//  Copyright (c) 2015年 MyMac. All rights reserved.
//

#import "PushViewController.h"

@interface PushViewController ()

@end

@implementation PushViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor redColor];
    // Do any additional setup after loading the view.
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    CATransition*diss=[CATransition animation];
    diss.type=@"cube";
    diss.duration=2.0;
    diss.subtype=kCATransitionFromRight;
    [self.view.layer addAnimation:diss forKey:nil];
    
//    [CATransaction begin];
//    CATransition *transition = [CATransition animation];
//    transition.type = @"cube";
//    transition.duration = 0.5f;
//    transition.fillMode = kCAFillModeForwards;
//    transition.removedOnCompletion = YES;
//    
//    [[UIApplication sharedApplication].keyWindow.layer addAnimation:transition forKey:@"transition"];
//    [[UIApplication sharedApplication] beginIgnoringInteractionEvents];
//    [CATransaction setCompletionBlock: ^ {
//        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(transition.duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^ {
//            [[UIApplication sharedApplication] endIgnoringInteractionEvents];
//        });
//    }];
    [self dismissViewControllerAnimated:YES completion:nil];




}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
